package com.speedchina.permission.domain.test.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.speedchina.framework.base.TEntity;
import com.speedchina.framework.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 测试-书籍 实体类
 *
 * @author hank
 * @create 2021-04-02 下午8:15
 **/
@Data
@TableName("t_test_book")
public class Book extends TEntity<Book> {
    /**
     * 主键
     */
    @TableId
    @NotNull(message = "主键不可为null", groups = {UpdateGroup.class})
    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "书名")
    private String title;
    @ApiModelProperty(value = "售价")
    private BigDecimal price;
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "出版日期")
    private Date publishDate;

}
